function wd_get_fs(_type) {
	$.ajax({
		type : "post",
		url : "/member/info/getchild",
		dataType : "json",
		data : {
			page : $("#fs_page" + _type).val(),
			key : $("#fs_key" + _type).val(),
			type : _type
		},
		success : function(msg) {
			if (msg.status == 1) {
				$("#fs_tbody" + _type).html(msg.content);
			} else {
				alert_ts('请求失败！');
			}
			var _page = '';
			for ( _i = 1; _i < (msg.num + 1); _i++) {
				if (_i == msg.page) {
					_page += '<option selected value="' + _i + '">第' + _i + '页</option>'
				} else {
					_page += '<option value="' + _i + '">第' + _i + '页</option>'
				}
			}
			$("#fs_page" + _type).html(_page);
		}
	});
}

function bill_zf(_idx, _content) {
	bootbox.dialog({
		message : "是否关闭 <span class=\"label label-success\">" + _content + "</span> ?",
		title : "关闭订单提示",
		buttons : {
			success : {
				label : "<i class=\"fa  fa-compress\"></i> 取消操作",
				className : "default",
				callback : function() {
				}
			},
			danger : {
				label : "<i class=\"fa fa-send\"></i> 关闭订单",
				className : "red",
				callback : function() {
					$.ajax({
						type : "post",
						url : "/shop/bill_zf",
						dataType : "json",
						data : {
							idx : _idx
						},
						success : function(msg) {
							if (msg.type == 1) {
								setTimeout(function() {
									window.location.reload();
								}, 1500);
								alert_ts('关闭订单成功！');
							} else {
								alert_ts('抱歉，关闭订单失败！');
							}
						}
					});
				}
			}
		}
	});
}

function wd_yshb() {
	$.ajax({
		type : "post",
		url : "/shop/wd_yshb",
		dataType : "json",
		data : {
			page : $("#wd_yshb_page").val()
		},
		success : function(msg) {
			if (msg.type == 1) {
				$("#wd_yshb").html(msg.content);
			} else {
				alert_ts('请求失败！');
			}
			var _page = '';
			for ( _i = 1; _i < (msg.num + 1); _i++) {
				if (_i == msg.page) {
					_page += '<option selected value="' + _i + '">第' + _i + '页</option>'
				} else {
					_page += '<option value="' + _i + '">第' + _i + '页</option>'
				}
			}
			$("#wd_yshb_page").html(_page);
		}
	});
}

function wd_dshb() {
	$.ajax({
		type : "post",
		url : "/shop/wd_dshb",
		dataType : "json",
		data : {
			page : 0
		},
		success : function(msg) {
			if (msg.type == 1) {
				$("#wd_dshb").html(msg.content);
			} else {
				alert_ts('请求失败！');
			}
		}
	});
}
